package difangame.level;

import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.Image;
import difangame.Constants;
import framework.Level;


/**
 * 
 * @author difan
 * 
 */

public class Level5 extends Level {
    private Image mySplash = null;
    private final int myWidth = 315 / 3;
    private final int myHeight = 160 / 3;

    @Override
    protected void initializeLevel () {
        mySplash = super.getMyGame().loadImage("win.jpg");

    }

    @Override
    protected int testWinCondition () {
        if (getMyGame().getMyContainer().getLastKeyPressed().equalsIgnoreCase("s")) {
            return 1;
        }
        return -1;
    }

    @Override
    protected int testLoseCondition () {

        return -1;
    }

    @Override
    protected void levelBehavior () {

    }

    @Override
    protected void loadLevelObjects () {

    }

    @Override
    protected void paint (Graphics2D pen) {
        Dimension bounds = Constants.SIZE;
        pen.drawImage(mySplash, bounds.width / 2 - myWidth / 2, bounds.height / 2 - myHeight / 2,
                      myWidth, myHeight, null);

    }

}
